﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleRest.Core
{
    public static class ServiceUtility
    {
        public static bool IsValidService(this Type serviceType)
        {
            if (serviceType == null || !serviceType.IsClass)
                return false;

            foreach (var attr in serviceType.GetCustomAttributes(true))
                if (attr is ServiceAttribute)
                    return true;

            return false;
        }
    }
}
